package com.springboot.demo.dataobject.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.lang.annotation.Documented;

/**
 * @author 辜圆圆
 * @description: gzy的项目
 * @date 2020/4/22 1:20 上午
 */
@Data
// 作用在类，标记实体类为文档对象，索引库，索引库类型，shards分片，replicas副本数量
@Document(indexName = "blog",type="doc",createIndex=false)
public class EsBlog {
    // id就是唯一的存在啊
    @Id
    private Integer id;
    @Field(type = FieldType.text, analyzer = "ik_max_word")
    private String title;
    // keyword 不参与分词
    @Field(type = FieldType.keyword)
    private String author;
    @Field(type = FieldType.text, analyzer = "ik_max_word")
    private String content;
}
